<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

<script src="${pageContext.request.contextPath}/js/calendar_ru.js"
	type="text/javascript"></script>

<script type="text/javascript">
	function printdiv(idDiv) {
		var w = 800;
		var h = 600;
		var l = (window.screen.availWidth - w) / 2;
		var t = (window.screen.availHeight - h) / 2;

		var sOption = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,width="
				+ w + ",height=" + h + ",left=" + l + ",top=" + t;
		// Get the HTML content of the div
		var sDivText = window.document.getElementById(idDiv).innerHTML;
		// Open a new window
		var objWindow = window.open("", "Print", sOption);
		// Write the div element to the window
		objWindow.document.write(sDivText);
		objWindow.document.close();
		// Print the window            
		objWindow.print();
		// Close the window
		objWindow.close();
	}
</script>

<link href="style.css" rel="stylesheet" type="text/css">

<body class="body">
	<logic:present name="auth" scope="session">

		<html:form action="/adminConsol" method="POST">
			<table border='1' class="adminconsol">
				<tr>
					<td><bean:message key="label.train" /></td>
					<td><bean:message key="label.ondate" /></td>
					<td><bean:message key="label.between" /></td>
					<td></td>
					<td></td>
					<td></td>


				</tr>
				<tr>
					<td width="150">
						<html:select property="routs_name">
							<html:option value=""></html:option>
							<c:forEach var="rout" items="${routs}">
								<html:option value="${rout.id_routs}">${rout.name_routs}</html:option>
							</c:forEach>
						</html:select>
					</td>

					<td width="150"><input type="text" style="font-size: 16px"
						size="16" name="date1" value="" onfocus="this.select();lcs(this)"
						onclick="event.cancelBubble=true;this.select();lcs(this)"
						maxlength="10"></td>
					<td width="330"><input type="text" style="font-size: 16px"
						size="16" name="date2" value="" onfocus="this.select();lcs(this)"
						onclick="event.cancelBubble=true;this.select();lcs(this)"
						maxlength="10"> - <input type="text"
						style="font-size: 16px" size="16" name="date3" value=""
						onfocus="this.select();lcs(this)"
						onclick="event.cancelBubble=true;this.select();lcs(this)"
						maxlength="10"></td>
					<td><html:reset property="Clean">
							<bean:message key="button.clean" />
						</html:reset></td>
					<td><html:submit property="Show2">
							<bean:message key="button.show" />
						</html:submit></td>
					<td><html:submit property="All">
							<bean:message key="button.all" />
						</html:submit></td>

				</tr>
			</table>


		</html:form>
		<html:form action="/adminConsol" method="POST">
			<div id="divID">
				<table border='1' class="adminconsol">
					<tr align="center" style="font-weight: bold;">
						<td width="50"><bean:message key="label.id" /></td>
						<td width="150"><bean:message key="label.train" /></td>
						<td width="150"><bean:message key="label.routs" /></td>
						<td width="150"><bean:message key="label.name_order" /></td>
						<td width="150"><bean:message key="label.date_order" /></td>
						<td width="150"><bean:message key="label.date_routs" /></td>


					</tr>

					<c:forEach var="order" items="${orders}">
						<tr align="left">
							<td><html:checkbox property="id_check_order"
									value="${order.id_order}"></html:checkbox> ${order.id_order}</td>
							<td>- ${order.name_city}</td>
							<td><b> - ${order.name_routs} </b></td>
							<td>- ${order.name_order}</td>
							<td>- ${order.date_order}</td>
							<td>-${order.date_routs}</td>



						</tr>
					</c:forEach>


				</table>
			</div>
			<html:submit property="Show">
				<bean:message key="button.show" />
			</html:submit>
			<html:submit property="Delete"
				onclick="return confirm('Delete?')? true : false;">
				<bean:message key="button.delete" />
			</html:submit>
			<html:button property="print" onclick="printdiv('divID')">
				<bean:message key="button.print" />
			</html:button>


		</html:form>

	</logic:present>
</body>
